<template>
  <component :is="component" :key="app.name" class="je-admin-login" :app="app" @error="onError" />
</template>

<script>
  import { defineComponent, ref } from 'vue';
  import PageMicro from './micro.vue';
  import Login from '@common/components/login/index.vue';
  import { useAdminStore } from '@/stores/admin-store';
  export default defineComponent({
    name: 'AdminLogin',
    components: { PageMicro, Login },
    setup() {
      const adminStore = useAdminStore();
      const app = adminStore.getMicroConfig4Login();
      const component = ref('PageMicro');
      const onError = function () {
        component.value = 'Login';
      };
      return { app, component, onError };
    },
  });
</script>
